﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TheClerk.Forms
{
    /// <summary>
    /// Maintains list of Forms available
    /// </summary>
    public static class FormStore
    {
        private static SortedDictionary<string,Form> formlist;
        public static void Add(Form toAdd, string toName = null)
        {
            if (toName != null)
            {
                formlist.Add(toName, toAdd);
                return;
            }
            else
            {
                formlist.Add(toAdd.formID, toAdd);
            }
        }
        public static Form Get(string toGet)
        {
            return formlist[toGet] as Form;
        }
    }
}
